package tech.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.entity.Register;
import tech.aistar.mapper.RegisterMapper;
import tech.aistar.service.IRegisterService;

import java.util.List;

@Service
public class RegisterServiceImpl implements IRegisterService {
    @Autowired
    private RegisterMapper registerMapper;
    @Override
    public Register selectById(Integer id) {
       return registerMapper.selectById(id);
    }

    @Override
    public Register selectByAccount(String account) {
        return registerMapper.selectByAccount(account);
    }

    @Override
    public List<Register> selectAll() {
        return registerMapper.selectAll();
    }

    @Override
    public Register selectPassword(String account) {
        return registerMapper.selectPassword(account);
    }

    @Override
    public int updateById(Integer id, String password) {
        int count = registerMapper.updateById(id,password);
        return count;
    }

    @Override
    public void insert(Register register) {
        registerMapper.insert(register);
    }
}
